package com.lsy.poi.cell.validator;

import org.apache.poi.xssf.usermodel.XSSFCell;

import com.lsy.poi.Logger;
import com.lsy.poi.exception.ParseException;


public abstract class CellValidator extends Logger {
	
	public abstract void doValidate(Object cellValue, XSSFCell cell) throws ParseException;
	
	/**
	 * cell: 能提供 cell 的 坐标（创建 ParseException 时，需要用到）
	 */
	public void validate(Object cellValue, XSSFCell cell) { 
		
		try {
			
			doValidate(cellValue, cell);
			
		} catch (ParseException e) {
			logError(e);
		}
		
	}
	
}
